﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Util.Props
{
    /// <summary>
    /// A double property.
    /// </summary>
    [S4Property]
    public class S4Double:Attribute
    {
        /// <summary>
        /// Default value to return
        /// </summary>
        public const double NOT_DEFINED = -918273645.12345;
        public double[] DEFAULT_RANGE = { double.MinValue, double.MaxValue };
        public S4Double(double _vdefaultValue = NOT_DEFINED, double[] _vrange = null, Boolean _vmandatory = true)
        {
            // this default value will be mapped to zero by the configuration manager
            defaultValue = _vdefaultValue;
            range = _vrange;
            mandatory = _vmandatory;
        }

        private double _defaultValue = NOT_DEFINED;
        public double defaultValue
        {
            get{return _defaultValue;}
            set{_defaultValue = value;}
        }

        private double[] _range = { int.MinValue, int.MaxValue };
        public double[] range
        {
            get{return _range;}
            set
            {
                _range = (value == null) ? DEFAULT_RANGE : value;
            }
        }

        private Boolean _mandatory = true;
        public Boolean mandatory
        {
            get { return _mandatory; }
            set { _mandatory = value; }
        }
    }
}
